#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>

 char buf[256],
      cuf[256],
			tuf[256];

 FILE *f1,
      *f2,
			*f3;

 char fil1[260];
 char fil2[260];

byte Instr( char *s,  byte, char );
void Convert( char *, byte, byte );
void Lower( char *s );

void main( int  argc, char *argv[ ] )
{
  if ( argc > 1 )
  	strcpy( fil1, argv[1] );
  else {
    printf("Uasage: InFile.txt" );
    return;
  }// END IF

  clrscr( );
  Convert( fil1, '\\', '/' );

  f1 = fopen( fil1, "rt" );
  assert( f1 );

  strcpy( fil2, fil1 );
  strcpy( &fil2[ Instr( fil2, '.', 1) + 1 ], "c" );

  f2 = fopen( fil2,"wt" );		// text file
  assert( f2 );
  Lower( fil1 );

  while( fgets(buf, 256, f1) )
  { //
    if ( buf[0] ){
      sscanf( buf, "%s %s %s", &buf[128], &tuf, &cuf );
      if (


    }
  }// WEND



  fcloseall( );
}// END OF MAIN



/******************************
; Finds char in string        *
******************************/
byte Instr(char *s, byte chr, char way)
{
  int  xb;

  if (way == 0)
	{ //
   	xb = 0;
	  while( s[xb] != chr && xb < strlen(s) )
  	  xb++;
  }
  else
  { //
	  xb = strlen(s);
	  while( s[xb] != chr && xb > 0 )
	    xb--;
  }// END IF

  return xb;
}


void Convert(char *s,byte out,byte in)
{
  byte xx = -1;

  while( ++xx < strlen(s) )
    s[xx] = ( (s[xx] == out) ? in : s[xx] );

}// END OF SUB



void Lower(char *s)
{
  byte xx = -1;

  while( ++xx < strlen(s) )
    s[xx] = tolower( s[xx] );
}// END OF SUB